import java.util.Arrays;

public class Test {

    //数组创建定义  数组创建定义

    public static void main1(String[] args) { //数组创建定义
        int[] arr={1,2,3,4,5,6};
        int[] arr1=new int[]{1,2,3,4,5,6};
        int[] arr2=new int[10];
    }

    public static void main2(String[] args) { //数组创建定义
        int[] arr={1,2,3,4,5,6};
        System.out.println(arr[0]);
        System.out.println(arr[1]);
        System.out.println(arr.length);
        arr[0]=99;
        System.out.println(arr[0]);
    }

    public static void main3(String[] args) {
        int[] arr={1,2,3,4,5,6};
        //(1)
        for(int i=0;i<arr.length;i++)
        {
            System.out.print(arr[i]+" ");
        }
        System.out.println();
        //(2)
        for(int x:arr)
        {
            System.out.print(x+" ");
        }
        System.out.println();
        String ret= Arrays.toString(arr);
        System.out.println(ret);
    }

    public static void main(String[] args) {
        int[] arr={13,56,85,11,22,33};
        for(int x:arr)
        {
            System.out.print(x+" ");
        }
        System.out.println();
        Arrays.sort(arr);//排序
        String ret= Arrays.toString(arr);
        System.out.println(ret);
    }
}
